#pragma once
#include "CAction.h"

#define FILTER_ID 15



class CFilter :
	public CAction
{
public:
	CFilter(void);
	CFilter( CSeaAmp &seaAmp ) { Init( seaAmp ); }
	~CFilter(void);

	bool Init( CSeaAmp &seaAmp, int id = FILTER_ID ) { return CAction::Init( seaAmp, id ); }

	void DoAct( void );

	void SetPassFreq( double pf ) { passFreq = pf; a = 2 * PI * passFreq * timerPeriod/1000; }
	double GetPassFreq( void ) { return passFreq; }

	void SetTimerPeriod( double tp ) { timerPeriod = tp; a = 2 * PI * passFreq * timerPeriod; }
	double GetTimerPeriod( void ) { return timerPeriod; }

	void SetA( double as ) {a = as;}
	double GetA( void ) {return a;}

	void SetData( double *dataPtr) { data = dataPtr; }


private:

	double passFreq;

	double a;

	double *data;

	double lastData;

	double timerPeriod;

	


};

